<extend name="Public/base" />

<block name="body">
    <form method="POST" id="list" action="{:U('warnExport')}">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <div class="cf">
        <div class="search-form fr cf">
        </div>
    </div>
    </form>

    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table id="inventoryTable">
                <thead>
                    <tr>
                        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                        <th>日期</th>
                        <th>采购种类</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                        <volist name="_list" id="vo">
                            <tr>
                                <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                                <td>
                                    <a href="{:U('batchDetail')}&batch={$vo.batch}">{$vo.batch}</a>
                                </td>
                                <td>{$vo.cnt}</td>
                                <td>
                                    <if condition="$vo['status'] eq 2*$vo['cnt']">
                                        <span class="glyphicon glyphicon-remove-sign text-primary">待处理</span>
                                    </if>
                                    <if condition="$vo['status'] eq 3*$vo['cnt']">
                                        <span class="text-success glyphicon glyphicon-ok">已处理</span>
                                    </if>
                                    <if condition="($vo['status'] gt 2*$vo['cnt'])&&($vo['status'] lt 3*$vo['cnt'])">

                                        <span class="glyphicon glyphicon-paperclip text-warning">部分处理</span>
                                    </if>
                                </td>
                                <td>
                                    <!--<a class="btn btn-primary" ><span class="glyphicon glyphicon-time"></span> 待审核</a>-->
                                    <a href="{:U('predingjiaresult')}&batch={$vo.batch}" class="btn btn-primary">处理结果</a>
                                    <a href="{:U('assoproduct')}&batch={$vo.batch}" class="btn btn-default ">立即处理</a>
                                </td>
                            </tr>
                        </volist>
                </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('.input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
        //导航高亮
    highlight_subnav('{:U('Caigouer/index')}');
    </script>
</block>
